read user-defined exif tags#20872
Conversation
|
🎆 🎆 🎆 One issue - I added some fields and tested. Then I removed some fields and added different fields. When I did the save the image information module inverted the rows. Next, how can I access the information from Lua? It'll probably take an API change. Maybe I can extend dt_lua_image_t with maybe Very good! |
I have occasionally seen this in the image information module. |
I think it might have been that I removed and added fields at the same time and it just got confused. |
|
I think we need to add a note in the manual that the changes are only managed in the xmp / database. The raw file tags will remain unchanged. Maybe even tooltips since folks don't read the manual. |
|
@zisoft this works even better than I thought. I went to look at adding metadata access to
|
|
@wpferguson : Using only the last part of the tag name is ambiguous. That's the reason why I had to change the tag name variable expansion to the full tag name. |
in lua/image.c we do dt_pthread_mutex_lock(&darktable.metadata_threadsafe);
for(GList *iter = dt_metadata_get_list(); iter; iter = iter->next)
{
dt_metadata_t *metadata = iter->data;
if(!metadata->internal)
{
lua_pushcfunction(L, metadata_member);
dt_lua_type_register(L, dt_lua_image_t, dt_metadata_get_tag_subkey(metadata->tagname));
}
}
dt_pthread_mutex_unlock(&darktable.metadata_threadsafe);which adds the metadata fields to dt_lua_image_t as R/W members using the subkey. I can see where it could be ambiguous, but that might also be an advantage, if they agree on subkey, where all the maker specific information is excluded EDIT: The advantage comes with a caveat that the user only enables the metadata tag they need and not all of them 😄 |
That's my code :) When I changed the variable expansion to the full tag name I simply forgot to change that part as well. You are the lua expert, please decide what is best here. |
Between that and this PR it solves one of the biggest issues with Lua scripting, having to run an external executable to get metadata.
For now I'd say it's not broken, so let's not fix it. |
This change implements reading of exif tags which were added to the metadata editor.
In previous versions the metadata editor allowed to add all tags which are supported by exiv2. This led to some confusion when users added exif tags to the metadata editor and then expected these tags to be read on import, which didn't work.
The "solution" was to restrict the list of allowed tags for the metadata editor to only those tags which are supposed to be user-editable. I have removed this restriction, now the user has complete freedom on what tags to add.
Now on import or refresh EXIF the user-defined tags from the metadata editor are read from the image as well.
To test this I have added 5 exif tags to the metadata editor, which are definitely embedded in the image:
Which looks like this:
After importing a new image (or refresh EXIF on already existing ones):
Image information panel:
fixes #20856
@wpferguson : would you like to test?